package org.jeecg.modules.pacs.quartz;

import org.quartz.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class QuartzConfig {
    @Bean
    public JobDetail teatQuartzDetail(){
        return JobBuilder.newJob(FindAndAddMbsf.class).withIdentity("findAndAddMbsf").storeDurably().build();
    }


    @Bean
    public Trigger testQuartzTrigger(){
        CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule("0 0/1 * * * ? *");
        return TriggerBuilder.newTrigger().forJob(teatQuartzDetail())
                .withIdentity("findAndAddMbsf")
                .withSchedule(scheduleBuilder)
                .build();
    }

}